package com.ed100.sass;

import java.util.Random;

public class DemoServiceImpl {

	/**
	 * 随机id生成
	 */
	public static long getRandomId() {
		long millis = System.currentTimeMillis();
		// 加上两位随机数
		Random random = new Random();
		int end2 = random.nextInt(99);
		// 如果不足两位前面补0
		String str = millis + String.format("%02d", end2);
		long id = new Long(str);
		return id;
	}

	public static void main(String[] args) {
		System.out.println(getRandomId());
	}
}
